unit uLista_alugueis;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, Grids, DBGrids;

type
  TfLista_alugueis = class(TForm)
    DBGrid1: TDBGrid;
    DataSource1: TDataSource;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fLista_alugueis: TfLista_alugueis;

implementation

uses UDM;

{$R *.dfm}

procedure TfLista_alugueis.FormCreate(Sender: TObject);
begin
  if dm.cds_l_alugueis.Active then
    dm.cds_l_alugueis.Close;
  dm.cds_l_alugueis.Params[0].AsInteger :=
  dm.cds_imo_aluguelCOD_IMALU.AsInteger;
  dm.cds_l_alugueis.Open;

end;

procedure TfLista_alugueis.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin

 if dm.cds_l_alugueis.Active then
    dm.cds_l_alugueis.Close;

end;

end.
